In many software applications, it is necessary or desirable to perform operations on a periodically recurring basis. Further, it is desirable to perform such operations without requiring continuing user action to activate the operations, or in other words while unattended by the user. An example is a hard disk utility application such as a disk checker, defragmenter or virus scanner. These utility applications are desirably executed automatically on a periodically recurring basis (e.g., daily, weekly or just once per month) to prevent degradation of disk performance over time as a result of normal usage. Further, the user desirably is not forced to track when these operations are done, or to manually initiate the operations.
Typically, applications that perform operations on a periodically recurring basis have each implemented their own mechanisms to schedule the recurring operations, initiate the operations on the scheduled basis, and monitor the results. In an electronic mail application for example, mail software at a client computer on a network may include code to periodically check for new messages at a mail server on the network. If there are new messages, the client mail software transfers the mail messages to the client computer from the network's mail server and may also display a notice to the user that a new message has arrived.
This typical practice of each application separately implementing mechanisms to support periodically recurring operations has several drawbacks. In order for the application to perform the periodically recurring operations while unattended by a user, the application must remain loaded and running on the computer. Because the application often does no useful work while waiting to perform its next periodically recurring operation, leaving the application running is wasteful of the computer's memory and processing capacities which could otherwise be used by other applications. If too many such applications are left running, the user may be unable to run applications for the user's immediate work activities, such as a spreadsheet, word processor or browser.
Another drawback is that this typical approach makes programming of periodically recurring operations more difficult. The mechanism that supports scheduling, initiating and monitoring of the periodically recurring operation is separately implemented in each application, often from scratch.
A software utility called the “system agent” in the Microsoft® Windows® 95 operating system operates as a general mechanism to trigger applications (e.g., a disk checker or defragmenter utility) according to a preset schedule of times. The system agent provides user interface dialogs in which the user selects a schedule of times (e.g., daily at 2 am, Tuesdays and Fridays at 4:30 pm, 9 pm on the third day of every month, etc.) at which to run a desired program (the “scheduled program”). When its user interface is closed, the system agent runs as a background task. When the scheduled program's next scheduled time arrives, the system agent loads and runs the scheduled program (using the CreateProcess API of Microsoft's Win32 API set). The scheduled program thus can perform a periodically recurring operation when it is run by the system agent at each of its scheduled times. When the operation is complete, the scheduled program must self terminate. Programs that implement a recurring operation thus are not left running between the scheduled times, which frees the computer's memory and processing capacity for use by other applications.
The Windows® 95 system agent utility has several drawbacks which limit its use by applications to provide periodically recurring operations. One drawback is that there are limited ways in which an application program can interact with the system agent utility. In general, each scheduled program is scheduled with the system agent by user input to the user interface of the system agent. Alternatively, the system agent stores information on the times of scheduled programs in a system registry. (The system registry is a database file which stores configuration information for the operating system.) An application program therefore can schedule a program that implements a desired recurring operation with the system agent by adding entries containing appropriate scheduling information into the system registry. Further, once the system agent starts the program at the scheduled time (using the CreateProcess API), the system agent does not further interact with the program. Also, if the scheduled program is scheduled by an application adding entries to the system registry, the system agent provides no way for that application to further interact with the scheduled program at the scheduled times. Thus, an application program is not able to programmatically schedule an operation with the system agent utility, programmatically control the performance of the operation at its scheduled times, or receive notifications to monitor the operation.
The present invention includes an object-oriented framework that provides a set of object integration interfaces which support programmatic scheduling, configuring, and notifications of periodically recurring operations. In other words, the framework acts as a system service or application programming interface to access services for an application program to schedule, configure, and subscribe to notifications from an agent program that implements a desired periodically recurring operation, and especially operations for change monitoring and updating of data.
The object-oriented framework in an illustrated embodiment of the invention includes a scheduler object that provides a set of integration interfaces with which a client application can programmatically schedule on a periodic basis initiating operations by an agent object in which the operations are implemented. A core object in the framework provides additional interfaces with which any client application can subscribe to receive notifications from the agent relating to the operation. The framework further defines interfaces for agent objects and for a call back object of the client application. The interfaces on the agent objects allow the client application to programmatically set options controlling the operation that the agent performs. The interfaces on the client application's call back object allow the client application to receive notifications from the agent as the operation is performed. The interfaces on the agent objects and client application call back objects also allow the framework to persisently store a state of the agent objects and client application call back objects so that the client application and agent objects can be terminated and unloaded from memory until the time for the operation arrives.
The object oriented framework of the invention overcomes many of the drawbacks of prior art mechanisms for performing periodically recurring operations. The framework allows a client application to programmatically control scheduling of the operation, and set options controlling the operation itself. The framework also allows client applications, including applications other than the client application which schedules a periodically recurring operation, to receive notifications and alerts pertaining to the operation. Additionally, the framework allows agent software in which the operation is implemented and the client application which schedules the operation to be terminated between times that the operation is performed, so as to free memory and processing capacity for use by other active applications.
A particular use of the framework is in a network environment, such as the Internet, to provide monitoring of data residing at a remote server for changes (“update checking”), and to download changed data to a user's computer so as to maintain an updated local copy of the data at the user's computer. The illustrated framework provides agent objects which implement various forms of such updating operations. These updating operations include an operation (herein called “smart folder updating”) to update the contents of a local folder (herein called a “smart folder”) as specified in a remote file. The updating operations also include an operation (herein called automatically populating and updating favorites categories) that automatically fill and periodically update lists of remote documents for a user to browse organized in categories.
The scheduler in the illustrated framework supports scheduling of an agent's updating operations on different periodic bases, which include at scheduled times and during network idle times. The scheduled times are times scheduled by the user at which the updating operation is automatically triggered by the scheduler to connect to the Internet or other network unattended, and perform the updating operation. The scheduler also can perform the update operations on a periodic basis by detecting times when the user is connected to the Internet for other activities (such as on-line browsing) and the connection is left idle. When such idle status is detected, the agent for the update operation automatically performs the update checking and downloading over the connection unattended as background processing to the user's other activities.
Additional features and advantages of the invention will be made apparent from the following detailed description of an illustrated embodiment which proceeds with reference to the accompanying drawings.